﻿using System;
using System.Windows;
using System.Windows.Data;

namespace IssueVision.Common
{
    /// <summary>
    /// Represents the converter that converts Byte values to and from Visibility enumeration values. 
    /// </summary>
    public sealed class ByteToVisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {

            return (((byte)value) != 0 ? Visibility.Visible : Visibility.Collapsed);
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotSupportedException();
        }
    }

}

